package com.hutianao.gqgl.information.internationalElectric.service.impl;

import com.hutianao.gqgl.information.internationalElectric.entity.SearchInternationalElectricEntity;
import com.hutianao.gqgl.information.internationalElectric.respository.InternationalElectricDao;
import com.hutianao.gqgl.information.internationalElectric.service.InternationalElectricService;
import com.hutianao.gqgl.mybatis.entity.InternationalElectricEntity;
import com.hutianao.gqgl.mybatis.flexigrid.PaddingEntity;
import com.hutianao.gqgl.mybatis.flexigrid.PadingRstType;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class InternationalElectricServiceImpl implements InternationalElectricService {
    @Resource
    private InternationalElectricDao InternationalElectricDao;

    @Override
    public PadingRstType<InternationalElectricEntity> queryInternationalElectricInfoListByPage(SearchInternationalElectricEntity search, PaddingEntity padding) {
        padding.deal(InternationalElectricEntity.class);
        PadingRstType<InternationalElectricEntity> padingRstType = new PadingRstType<>();
        padingRstType.setPage(padding.getPage());
        List<InternationalElectricEntity> list = InternationalElectricDao.queryInternationalElectricInfoListByPage(search,padding);
        padingRstType.setRawRecords(list);
        Integer total = InternationalElectricDao.queryInternationalElectricInfoTotal(search);
        padingRstType.setTotal(total);
        padingRstType.putItems();

        return padingRstType;
    }
}
